03. Data File for EKF project
Explanation of the Data File
The github repo contains one data file:
-
obj_pose-laser-radar-synthetic-input.txt
Here is a screenshot of the first data file:
The simulator will be using this data file, and feed main.cpp values from it one line at a time.
Each row represents a sensor measurement where the first column tells you if the measurement comes from radar (R) or lidar (L).
For a row containing radar data, the columns are:
sensor_type, rho_measured, phi_measured, rhodot_measured, timestamp, x_groundtruth, y_groundtruth, vx_groundtruth, vy_groundtruth, yaw_groundtruth, yawrate_groundtruth
.
For a row containing lidar data, the columns are:
sensor_type, x_measured, y_measured, timestamp, x_groundtruth, y_groundtruth, vx_groundtruth, vy_groundtruth, yaw_groundtruth, yawrate_groundtruth
.
Whereas radar has three measurements (rho, phi, rhodot), lidar has two measurements (x, y).
You will use the measurement values and timestamp in your Kalman filter algorithm. Groundtruth, which represents the actual path the bicycle took, is for calculating root mean squared error .
You do not need to worry about yaw and yaw rate ground truth values.
Reading in the Data
We have provided code that will read in and parse the data files for you. This code is in the
main.cpp
file. The
main.cpp
file creates instances of a
MeasurementPackage
.
If you look inside 'main.cpp', you will see code like:
MeasurementPackage meas_package;
meas_package.sensor_type_ = MeasurementPackage::LASER;
meas_package.raw_measurements_ = VectorXd(2);
meas_package.raw_measurements_ << px, py;
meas_package.timestamp_ = timestamp;
and
vector<VectorXd> ground_truth;
VectorXd gt_values(4);
gt_values(0) = x_gt;
gt_values(1) = y_gt;
gt_values(2) = vx_gt;
gt_values(3) = vy_gt;
ground_truth.push_back(gt_values);
The code reads in the data file line by line. The measurement data for each line gets pushed onto a
measurement_pack_list
. The ground truth
[p_x, p_y, v_x, v_y]
for each line in the data file gets pushed onto
ground_truth
so RMSE can be calculated later from
tools.cpp
.